window Exception Handler
public final static ProvidedValue<WindowExceptionHandlerFactory> windowExceptionHandler(WindowExceptionHandler handler)
public final static ProvidedValue<WindowExceptionHandlerFactory> windowExceptionHandler(WindowExceptionHandler handler)
Provides a window exception handler for LocalWindowExceptionHandlerFactory composition variable.
Usage example:
CompositionLocalProvider(
windowExceptionHandler { throwable, _ -> throwable.printStackTrace() }
) {
// All uncaught exceptions will be printed to `std.out`.
}
Content copied to clipboard
Please note, the passed WindowExceptionHandler is NOT global. It will be used only within the composition it was provided for AND within a window. As for now, it is impossible to handle uncaught exceptions globally. If your application doesn't have a window (tray-only app), then this handler will not be called. See issue in Compose.
Since
8.0.0